<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>react bind this</title>
	</head>

	<body>
		<script>
			class As {
				constructor() {
					'use strict'
					this.name = 'name'
					this.say = this.say.bind(this)
				}

				say() {
					'use strict'
					console.log('this == undefined', this)
					return this
				}

				eat() {
					this.say()
				}

				run = () => {
					return this
				}
			}

			const as = new As()
			console.log('as', as)
			console.log('eat', as.eat() == undefined)
			console.log('run', as.run())
		</script>
	</body>
</html>
